package cn.newstrength.shangyujie.step;

import cn.newstrength.wtdf.plugin.util.TranUtils;
import cn.newstrength.wtdf.web.processor.Operation;
import cn.newstrength.wtdf.web.processor.OperationStep;
import cn.newstrength.wtdf.web.util.StepUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

/**
 * Step 流程之间的跳转Sample
 * @author Xd
 *
 */
public class FlowStep implements OperationStep {

	private final static Logger logger = LoggerFactory.getLogger(FlowStep.class);

	@Override
	public int excute(Operation oper) {

		logger.info("欢迎使用");
		Map<String, Object> input = StepUtils.getInputValue(oper,oper.getMapSet());
		logger.info("当前Step总线数据：{}",TranUtils.toJson(input));
		//这个值将传送到下一个Step执行一个Mybatis查询
		oper.setTranStepSuccResult("Xd");
		return 0;
	}

	@Override
	public int init(Map<String, String> arg0) {
		return 0;
	}
}
